import React, { Component } from "react";
import store from "@/store";
import { Redirect } from "react-router-dom";
const checkLoginHoc = (CMP) => {
  return class extends Component {
    render() {
      if (!store.getState().user.toJS()) {
        return <Redirect to="/login" />;
      }
      return <CMP {...this.props} />;
    }
  };
};
export default checkLoginHoc
